package org.hzero.business.report.dto;


import java.util.StringJoiner;

/**
 * 简易报表行字段
 *
 * @author: tianhao.luo@hand-china.com 2021/2/19  16:11
 */
public class KnifeReportLineColumn {
    /**
     * 前端需要 标题字段
     */
    private final String title;
    /**
     * 前端需要 数据位置字段
     */
    private final Integer dataIndex;
    /**
     * 前端需要 数据布局
     */
    private final String align;
    /**
     * 前端需要 宽度
     */
    private final Integer width;


    public KnifeReportLineColumn(String title, Integer dataIndex, String align, Integer width) {
        this.title = title;
        this.dataIndex = dataIndex;
        this.align = align;
        this.width = width;
    }

    @Override
    public String toString() {
        return new StringJoiner(", ", KnifeReportLineColumn.class.getSimpleName() + "[", "]")
                .add("title='" + title + "'")
                .add("dataIndex=" + dataIndex)
                .add("align='" + align + "'")
                .add("width=" + width)
                .toString();
    }

    public String getTitle() {
        return title;
    }

    public Integer getDataIndex() {
        return dataIndex;
    }

    public String getAlign() {
        return align;
    }

    public Integer getWidth() {
        return width;
    }
}
